#ifndef SSICLOUD_SURVEY_SELECT_H
#define SSICLOUD_SURVEY_SELECT_H

#include "ssicloud_list_object.h"
#include "ssicloud_item_object.h"

namespace ssicloud {

/**
 * @brief The SurveySelectQuery class
 *  问卷调查 - 分页查询
 */
class SurveySelectQuery : public ListObject<SurveySelectQueryLNode> {
public:
    SurveySelectQuery();

    //! 获取数据
    bool requestAll(int pageNum = 1, int pageSize = 10);

    //! 调试信息
    void profile();

protected:
    //! 分析数据
    int genResult(NetBuffer *data);

private:
    char m_body[1024];
};

/**
 * @brief The SurveySelectDetail class
 *  问卷调查 - 详情
 */
class SurveySelectDetail : public  ListObject<SurveySelectDetailLNode> {
public:
    SurveySelectDetail();

    //! 获取数据
    bool requestAll(const char *id = "882429bfa53deea8093fd90159465d62");

    //! 调试信息
    void profile();

protected:
    //! 分析数据
    int genResult(NetBuffer *data);

    // request
    SFString m_id;

    // responed

};

/**
 * @brief The SurveySubmit class
 *  问卷调查 - 提交
 */
class SurveySubmit : public ItemObject<EmptyInfoNode>
{
public:
    class Answer {
    public:
        SFString               surveyId;
        std::list<std::string> optionId;
    };
    typedef std::list<Answer> AnswersList;

    SurveySubmit();

    //! 获取数据
    bool submit(const SFString &mainId, const SFString &beginTime, const AnswersList &answers);

    //! 分析数据
    int genResult(NetBuffer *data);

    //! 调试信息
    void profile();

private:
    char m_body[1024];
};

}

#endif // SSICLOUD_SURVEY_SELECT_H
